<!-- 提示文字组件 -->
<template>
  <component
    :is="h(ElTooltip, { ...$attrs, ...props, ref: changeRef }, $slots)"
    class="base-tooltip"
    :show-after="showAfter"
    :effect="effect"
    :virtual-triggering="!!virtualRef"
    :virtual-ref="virtualRef"
  />
</template>

<script lang="ts" setup>
import { ElTooltip } from "element-plus";
const props = withDefaults(
  defineProps<{
    virtualRef?: any;
    showAfter?: number;
    effect?: "dark" | "light";
    // content?:string;
    // placement="left"
  }>(),
  { showAfter: 500 }
);
// 修改ref
const vm: any = getCurrentInstance();
function changeRef(instance: any) {
  vm.exposeProxy = vm.exposed = instance || {};
}
</script>
